import collections
class Solution(object):
    def maxNumberOfBalloons(self, text):
        """
        :type text: str
        :rtype: int
        """
        c = collections.Counter(text)
        max_value = float('inf')
        for w in {'b', 'a', 'n'}:
            max_value = min(max_value, c[w])
        for w in {'l', 'o'}:
            max_value = min(max_value, c[w] // 2)
        return max_value



